package cn.itcast.mapper;

import cn.itcast.pojo.Clazz;
import cn.itcast.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {

    @Select("select * from dept")
    public List<Dept> findAll();
    //根据id删除部门
    @Delete("delete from dept where id = #{id}")
    public int deleteById(int id);
    //添加部门
    @Insert("insert into dept values (null,#{name},#{createTime},#{updateTime})")
    public int add(Dept dept);

    @Select("select * from dept where id = #{id}")
    public Dept findById(int id);

    @Update("update dept set name = #{name},update_time = #{updateTime} where id = #{id}")
    public int update(Dept dept);
    //upda de set na = #{na},up -ti = uT wh  id= #{id}
 }
